package cc.fs.zhihuapp.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.Arrays;

/**
 * Created by fostion on 2015/8/20.
 */
public class NewsHtml implements Parcelable {

    String id;
    String title;
    String body;
    String image_source;
    String image;
    String type;
    String share_url;
    String ga_prefix;
    String js[];
    String css[];

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getImage_source() {
        return image_source;
    }

    public void setImage_source(String image_source) {
        this.image_source = image_source;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getShare_url() {
        return share_url;
    }

    public void setShare_url(String share_url) {
        this.share_url = share_url;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getGa_prefix() {
        return ga_prefix;
    }

    public void setGa_prefix(String ga_prefix) {
        this.ga_prefix = ga_prefix;
    }

    public String[] getJs() {
        return js;
    }

    public void setJs(String[] js) {
        this.js = js;
    }

    public String[] getCss() {
        return css;
    }

    public void setCss(String[] css) {
        this.css = css;
    }

    @Override
    public String toString() {
        return "NewsHtml{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", body='" + body + '\'' +
                ", image_source='" + image_source + '\'' +
                ", image='" + image + '\'' +
                ", type='" + type + '\'' +
                ", share_url='" + share_url + '\'' +
                ", ga_prefix='" + ga_prefix + '\'' +
                ", js=" + Arrays.toString(js) +
                ", css=" + Arrays.toString(css) +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.title);
        dest.writeString(this.body);
        dest.writeString(this.image_source);
        dest.writeString(this.image);
        dest.writeString(this.type);
        dest.writeString(this.share_url);
        dest.writeString(this.ga_prefix);
        dest.writeStringArray(this.js);
        dest.writeStringArray(this.css);
    }

    public NewsHtml() {
    }

    protected NewsHtml(Parcel in) {
        this.id = in.readString();
        this.title = in.readString();
        this.body = in.readString();
        this.image_source = in.readString();
        this.image = in.readString();
        this.type = in.readString();
        this.share_url = in.readString();
        this.ga_prefix = in.readString();
        this.js = in.createStringArray();
        this.css = in.createStringArray();
    }

    public static final Parcelable.Creator<NewsHtml> CREATOR = new Parcelable.Creator<NewsHtml>() {
        public NewsHtml createFromParcel(Parcel source) {
            return new NewsHtml(source);
        }

        public NewsHtml[] newArray(int size) {
            return new NewsHtml[size];
        }
    };
}
